﻿<Page x:Class="DTC.Pages.JournalPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
      xmlns:Local="clr-namespace:DTC"
    Title="JournalPage" MaxHeight="950" MaxWidth="1300">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/ListBoxStyles.xaml"/>
                <ResourceDictionary Source="../Resources/ButtonsStyles.xaml"/>
                <ResourceDictionary Source="../Resources/BorderStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid Margin="20,40,20,50">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="170"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
		<Border BorderBrush="{StaticResource ListBorder}"
				BorderThickness="1"
				CornerRadius="6"
				Grid.Row="0"
				Grid.RowSpan="2"
				SnapsToDevicePixels="True"
				HorizontalAlignment="Left"
				Margin="0,0,25,15"
				Background="White">
			<Expander Name="CalendarExpander"
					ExpandDirection="Right">
                <Expander.Header>
                    <TextBlock Text="Календарь"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               FontSize="16">
                        <TextBlock.LayoutTransform>
                            <RotateTransform Angle="-90"/>
                        </TextBlock.LayoutTransform>
                    </TextBlock>
                </Expander.Header>
        		<toolkit:Calendar VerticalAlignment="Top"
					 			HorizontalAlignment="Center"
                     			Name="calendar1" 
                     			Width="180" Height="180" 
								Margin="5"
                     			SelectedDatesChanged="calendar1_SelectedDatesChanged" />
			</Expander>
		</Border>
		<Border BorderBrush="{StaticResource ListBorder}"
				BorderThickness="1"
				SnapsToDevicePixels="True"
				CornerRadius="6"
				HorizontalAlignment="Left"
				Grid.Row="2"
				Width="Auto"
				Margin="0,0,30,0"
				Background="White">
		<Expander Name="DoctorsListExpander"
					ExpandDirection="Right">
            <Expander.Header>
                    <TextBlock Text="Врачи"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               FontSize="16">
                        <TextBlock.LayoutTransform>
                            <RotateTransform Angle="-90"/>
                        </TextBlock.LayoutTransform>
                    </TextBlock>
                </Expander.Header>
        <Grid Margin="5">
            <ListBox Name="DoctorsListBox"
                     HorizontalContentAlignment="Stretch"
					 ItemContainerStyle="{StaticResource ColorListBoxItem}"
					 Width="300">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Height="35">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="15"/>
                            </Grid.ColumnDefinitions>
                            <Border Margin="4,4,0,4"
									BorderBrush="{StaticResource ListBoxItemBorderBrush}"
									BorderThickness="1"
									CornerRadius="3">
                                <TextBlock Text="{Binding Path=FullName}" 
                                	       HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        	</Border>
                            <Button Name="DeleteDoctorButton"
									Grid.Column="1"
									Height="16"
									Width="8"
									Margin="2,0,0,0"
									Style="{StaticResource DelRecButton}"
									HorizontalAlignment="Right"
									VerticalAlignment="Bottom"
                                    Click="DeleteDoctorButton_Click"
                                    Tag="{Binding}"
                                    >
                                <Button.ToolTip>
                                    <ToolTip Style="{StaticResource DefaultToolTipStyle}"
												Height="33"
												Width="75"
												VerticalOffset="-22">
                                        <TextBlock Text="Удалить"/>
									</ToolTip>
                                </Button.ToolTip>
                            </Button>
                            <Button Name="ViewDoctorButton"
									Grid.Column="1"
									Height="16"
									Width="8"
									Margin="2,0,0,0"
									Style="{StaticResource ViewRecButton}"
									HorizontalAlignment="Right"
									VerticalAlignment="Top"
                                    Click="ViewDoctorButton_Click"
                                    Tag="{Binding}">
                                <Button.ToolTip>
                                    <ToolTip Style="{StaticResource DefaultToolTipStyle}"
												Height="33"
												Width="75"
												VerticalOffset="-22">
                                        <TextBlock Text="Изменить"/>
									</ToolTip>
                                </Button.ToolTip>
                            </Button>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Border Grid.Row="1"
				Style="{StaticResource ListBoxControlPanel}"
				Margin="1,1,0,1"
				Width="25"
				VerticalAlignment="Stretch" HorizontalAlignment="Left">
                <Button Name="NewDoctorButton" 
                HorizontalAlignment="Center" 
                VerticalAlignment="Top"
                Height="18" Width="18"
				Margin="0,5,0,0"
                   Tag="{Binding}"
                Style="{StaticResource AddRecButton}"
                    Click="NewDoctorButton_Click"/>
            </Border>
        </Grid>
		</Expander>
		</Border>
		<Border CornerRadius="8"
				BorderBrush="{StaticResource ListBorder}"
				Grid.Column="1" Grid.Row="0" 
				BorderThickness="1"
				SnapsToDevicePixels="True"
				HorizontalAlignment="Center"
				Background="{StaticResource WindowHeaderGradient}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90"/>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition Width="90"/>
            </Grid.ColumnDefinitions>
            <Button Grid.Column="0"
					BorderThickness="0"
                    Name="MoveLeftButton"
					SnapsToDevicePixels="True"
                    Style="{StaticResource LeftNavigationButton}" Click="MoveLeftButton_Click">
            </Button>
			<Border Grid.Column="1">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="20"/>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="20"/>
					</Grid.ColumnDefinitions>
					<Path Margin="0,1,0,0"
                              Fill="Blue"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Opacity="1"
                              Data="M 0 5 L 10 0 L 10 10 Z"/>
            	<TextBlock Name="DateTB" 
							FontSize="16"
							Grid.Column="1"
							VerticalAlignment="Center" 
							HorizontalAlignment="Center"
							FontWeight="Bold" Foreground="Black"/>
					<Path Grid.Column="2"
                              Margin="0,1,0,0"
                              Fill="Blue"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Opacity="1"
                              Data="M 0 0 L 0 10 L 10 5 Z"/>
				</Grid>
			</Border>
            <Button Grid.Column="2"
                    Name="MoveRightButton"
					SnapsToDevicePixels="True"
					BorderThickness="0"
                    Style="{StaticResource RightNavigationButton}" Click="MoveRightButton_Click">
            </Button>
			<Border Background="#557888F5"
					BorderBrush="Gray" 
					BorderThickness="0"
					Grid.Column="1">
                         <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0.507*"/>
                                <RowDefinition Height="0.493*"/>
                            </Grid.RowDefinitions>
                            <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                                        <GradientStop Color="#99FFFFFF" Offset="0"/>
                                        <GradientStop Color="#33FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Grid>
                    </Border>
        </Grid>
		</Border>
        <Grid 
            Grid.Column="1" Grid.ColumnSpan="2" 
            Grid.Row="1" Grid.RowSpan="3" 
            Margin="0,3,0,0"
            Name="Battlefield">
            <Local:JournalChart x:Name="Chart" Margin="0,15,0,0"/>
        </Grid>
    </Grid>
</Page>
